﻿#ifndef PREFERENCES_H
#define PREFERENCES_H

#include "colorselectbutton.h"
#include "config.h"
#include "sessionmanager.h"
#include <QFileDialog>
#include <QDialog>
#include "widget.h"

namespace Ui {
class Preferences;
}

class Preferences : public QDialog
{
    Q_OBJECT

private:
    Ui::Preferences *ui;
    Config* m_config;
    QFileDialog *m_fileDialog;
    SessionManager* m_sessionManager;
    void readGlobalOptions ();
    bool userAgrees(const QString &text);
    ColorSelectButton* m_colorSelectButton;

private slots:
    void on_optionAutoSaveScannedFiles_clicked(bool checked);
    void on_findPath_clicked();
    void on_optionPathForScannedFiles_editingFinished();

    void on_optionsClose_clicked();

    void on_optionClearRecentFileList_clicked();

    void on_optionRecentFilesMax_valueChanged(int val);

public:
    explicit Preferences(SessionManager *sessionManager, CenteredWidget *parent = 0);
    ~Preferences();

protected:
    void changeEvent(QEvent *e);

};

#endif // PREFERENCES_H
